package com.qkst.website.web.mapper;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.qkst.website.web.bean.BargainLogBean;
import com.qkst.website.web.entity.BargainLog;
@Repository("bargainLogMapper")
public interface BargainLogMapper {
    /**
     * 根据主键删除数据库的记录
     *
     * @param bargainId
     */
    int deleteByPrimaryKey(Long bargainId);

    /**
     * 插入数据库记录
     *
     * @param record
     */
    int insert(BargainLog record);

    /**
     * 插入数据库记录
     *
     * @param record
     */
    int insertSelective(BargainLog record);

    /**
     * 根据主键获取一条数据库记录
     *
     * @param bargainId
     */
    BargainLog selectByPrimaryKey(Long bargainId);

    /**
     * 根据主键来更新部分数据库记录
     *
     * @param record
     */
    int updateByPrimaryKeySelective(BargainLog record);

    /**
     * 根据主键来更新数据库记录
     *
     * @param record
     */
    int updateByPrimaryKey(BargainLog record);

	/**查询砍价记录
	 * @param bargainLog
	 * @return
	 */
	List<BargainLogBean> selectBargainLogList(BargainLogBean bargainLog);

	/**
	 * 查询总记录数
	 * @param bargainLog
	 * @return
	 */
	int selectCount(BargainLogBean bargainLog);

	/**
	 * 根据条件查询砍价记录信息
	 * @param bargainLog
	 * @return
	 */
	List<BargainLogBean> selectBargainLogByCondition(BargainLogBean bargainLog);

	/**查询砍价金额
	 * @param bargain
	 * @return
	 */
	BargainLogBean sumBargainPriceByConditions(BargainLogBean bargain);

	/**
	 * 根据token查询Bargain
	 * @param token
	 * @return
	 */
	BargainLogBean selectBargainLogByToken(String token);
}